package xiangmu.schoolpaper.service.impl.system;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xiangmu.schoolpaper.mapper.system.StatisticAnalysisMapper;
import xiangmu.schoolpaper.pojo.VO.*;
import xiangmu.schoolpaper.service.system.StatisticAnalysisService;
import java.util.List;

@Service
public class StatisticAnalysisServiceImpl implements StatisticAnalysisService {
    @Autowired
    private StatisticAnalysisMapper statisticAnalysisMapper;

//    111年份单选-专业单选
//    111-1概览情况
    @Override
    public SystemSA111viewVO oneYearOneMajorView(Integer graduationYear, String majorName) {
        return statisticAnalysisMapper.oneYearOneMajorView(graduationYear, majorName);
    }

    //    111-2图表区域
    @Override
    public SystemSA111ChartVO oneYearOneMajorChart(Integer graduationYear, String majorName) {
        List<SystemSA111ChartByTeacherVO> list = statisticAnalysisMapper.oneYearOneMajorChart(graduationYear, majorName);
        SystemSA111ChartVO vo = new SystemSA111ChartVO();
        vo.setTeachers(list);
        return vo;
    }

//    112年份单选-专业多选
//    112-1概览情况
    @Override
    public SystemSA112ViewVO oneYearMultiMajorView(Integer graduationYear, String majorNames) {
        return statisticAnalysisMapper.oneYearMultiMajorView(graduationYear, majorNames);
    }
//    112-2图表区域
    @Override
    public  SystemSA112ChartVO oneYearMultiMajorChart(Integer graduationYear, String majorNames) {
        List<SystemSA112ChartByMajorVO> list = statisticAnalysisMapper.oneYearMultiMajorChart(graduationYear, majorNames);
        SystemSA112ChartVO vo = new SystemSA112ChartVO();
        vo.setMajors(list);
        return vo;
    }

//    112年份单选-老师单选
//    112-1概览情况
    @Override
    public SystemSA121viewVO oneYearOneTeacherView(Integer graduationYear, String teacherAccount) {
        return statisticAnalysisMapper.oneYearOneTeacherView(graduationYear, teacherAccount);
    }
//    121-2图表区域
    @Override
    public SystemSA121ChartVO oneYearOneTeacherChart(Integer graduationYear, String teacherAccount) {
        List<SystemSA121ChartByStudentVO> list = statisticAnalysisMapper.oneYearOneTeacherChart(graduationYear, teacherAccount);
        SystemSA121ChartVO vo = new SystemSA121ChartVO();
        vo.setStudents(list);
        return vo;
    }

//    122年份单选-老师多选
//    122-1概览情况
    @Override
    public SystemSA122ViewVO oneYearMultiTeacherView(Integer graduationYear,String teacherAccounts) {
        return statisticAnalysisMapper.oneYearMultiTeacherView(graduationYear, teacherAccounts);
    }
//    122-2图表区域
    @Override
    public SystemSA122ChartVO oneYearMultiTeacherChart(Integer graduationYear, String teacherAccounts) {
        List<SystemSA122ChartByTeacherAccountVO> list = statisticAnalysisMapper.oneYearMultiTeacherChart(graduationYear, teacherAccounts);
        SystemSA122ChartVO vo = new SystemSA122ChartVO();
        vo.setTeachers(list);
        return vo;
    }

//    22专业单选-年份多选
//    22-1概览情况
    @Override
    public SystemSA22ViewVO oneMajorMultiYearView(String majorName, String graduationYears) {
        return statisticAnalysisMapper.oneMajorMultiYearView(majorName, graduationYears);
    }
//    22-2图表区域
    @Override
    public SystemSA22ChartVO oneMajorMultiYearChart(String majorName, String graduationYears) {
        List<SystemSA22ChartByGraduationYearVO> list = statisticAnalysisMapper.oneMajorMultiYearChart(majorName, graduationYears);
        SystemSA22ChartVO vo = new SystemSA22ChartVO();
        vo.setYears(list);
        return vo;
    }



    //32-1年份多选-老师单选
    @Override
    public SystemSA32ViewVO oneTeacherMultiYearView(String teacherAccount, String graduationYears) {
        return statisticAnalysisMapper.oneTeacherMultiYearView(teacherAccount, graduationYears);
    }

    @Override
    public SystemSA32ChartVO oneTeacherMultiYearChart(String teacherAccount, String graduationYears) {
        List<SystemSA32ChartByOneTeacherVO> list=statisticAnalysisMapper.oneTeacherMultiYearChart(teacherAccount, graduationYears);
        SystemSA32ChartVO vo = new SystemSA32ChartVO();
        vo.setYears(list);
        return vo;
    }
}
